<?php

namespace App\Http\Controllers\user;

use App\Dao\OrdersDao;
use App\Exceptions\SysExceptions;
use App\Services\Code;

class OrdersController extends BaseController
{
    /**
     * @throws SysExceptions
     */
    public function create_order(): array
    {
        $params = array_merge(request()->all(),[
            'user_id'=>getUserToken()
        ]);
        OrdersDao::create_order( $params );
        return Code::message('',200);
    }

    public function orders(): array
    {
        $params = array_merge(request()->all(),[
            'user_id'=>getUserToken()
        ]);
        return Code::message('',200,OrdersDao::orders($params));
    }




}
